from Graph import Graph

def main():

    labyrinth = [[0,0,0,0,0,0,3,0], 
                 [0,1,0,1,1,1,1,0], 
                 [0,1,1,1,0,1,0,0], 
                 [0,1,0,0,0,0,0,0], 
                 [0,1,1,0,1,1,1,0], 
                 [0,0,1,1,1,0,0,0], 
                 [0,1,1,0,1,1,1,1], 
                 [0,2,0,0,0,0,0,0]] 

    labyrinth1 = [[0,0,0,0,0,0,3,0], 
                  [0,0,0,1,1,1,1,0], 
                  [0,0,1,1,0,1,0,0], 
                  [0,0,1,0,0,0,0,0], 
                  [0,1,1,0,0,0,0,0], 
                  [0,0,1,1,1,0,0,0], 
                  [0,1,1,0,1,1,1,3], 
                  [0,2,0,0,0,0,0,0]] 

    labyrinth2 = [[0,0,0,0,0,0,3,0], 
                  [1,1,1,1,1,1,1,0], 
                  [1,0,0,0,0,0,1,0], 
                  [1,0,0,0,0,0,1,0], 
                  [1,1,1,1,1,1,1,0], 
                  [0,0,1,0,0,0,0,0], 
                  [0,1,1,0,0,0,0,0], 
                  [0,2,0,0,0,0,0,0]] 

    labyrinth3 = [[0,0,0,1,1,1,3,0], 
                  [0,1,1,1,0,0,0,0], 
                  [0,1,0,0,0,1,1,1], 
                  [0,1,0,0,0,1,0,1], 
                  [0,1,1,1,1,1,0,1], 
                  [0,0,0,1,0,0,0,1], 
                  [0,1,1,1,0,1,1,1], 
                  [0,2,0,0,0,0,0,0]]  

    graph = Graph()

    graph.GeneratetNodes(labyrinth, 8, 8)
    graph.GenerateLinks()

    #graph.printNodes()
    startx = 1
    starty = 7
    path = []
    x,y = graph.findDestDepth(startx,starty)
    print('X: ', x,' ', 'Y: ', y)

    x,y = graph.findDestBreadth(startx,starty)
    print('X: ', x,' ', 'Y: ', y)

    x,y,path = graph.findDestAStar(startx,starty)
    print('X: ', x,' ', 'Y: ', y)
    print()
    print("Path to destination is: ")
    for n in path:
            print(n.iXcoord, ',' , n.iYcoord)

main()
